package com.mnsq.common.bean.entity.subject;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.mnsq.common.bean.entity.CommonEntity;
import com.mnsq.common.bean.entity.user.User;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.*;

/**
 * @author 周俭
 */
@Data
@Accessors(chain = true)
@Entity
@Table(name = "user_dynamic")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UserDynamic extends CommonEntity {
    private static final long serialVersionUID = 5758608423896057645L;
    @Column(name = "content", columnDefinition = "text default null comment '用户动态内容，文本'")
    private String content;
    @Column(name = "img_urls", columnDefinition = "text default null comment '图片地址集合，逗号间隔'")
    private String imgUrls;
    @Column(name = "like_count", columnDefinition = "bigint(19) default 0 comment '点赞数量'")
    private Long likeCount;
    @Column(name = "comment_count", columnDefinition = "bigint(19) default 0 comment '评论数量'")
    private Long commentCount;

    @ManyToOne
    @JoinColumn(name = "create_user_id", insertable = false, updatable = false, referencedColumnName = "id")
    private User user;
}
